package log;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Date;

public class LoginLog implements Log{
    @Override
    public void log(String user, String msg) {
        System.out.println("=====写入登录日志=====");
        Date date = new Date();
        try (BufferedWriter writer = new BufferedWriter(new FileWriter("System\\src\\log\\LoginLog.txt", true))) {
            writer.write("用户： " + user + " 操作： " + msg + " 日期: " + date + "\n");
            writer.newLine();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
